package com.baseweb.webadmin.core.constants;

import java.util.ArrayList;
import java.util.List;

public enum ScheduleType {
    LUNCH(1,"午宴"), DINNER(2,"晚宴");

    private int code;
    private String name;
    ScheduleType(int code, String name){
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static List<ScheduleType> getAllData(){
        List<ScheduleType> result = new ArrayList<ScheduleType>();
        for (ScheduleType current : ScheduleType.values())
        {
            result.add(current);
        }
        return result;
    }

    public static ScheduleType getByName(String dinnerName){
        for (ScheduleType current : ScheduleType.values())
        {
            if (current.getName().equalsIgnoreCase(dinnerName)){
                return current;
            }
        }
        return null;
    }


//    public static void main(String[] args) {
//        for(ChannelType c : getAllChannel()){
//            System.out.print(c.getName());
//        }
//    }
}
